// 该文件专门用于暴露一个store对象，整个应用只有一个store对象
// 引入legacy_createStore,专门用于创建redux中最为核心的store对象
import { legacy_createStore as createStore, combineReducers } from "redux";
import { CollApsedReducer } from "./reducer/CollapsedReducer.js";
import { LoadingReducer } from "./reducer/LoadingReducer";
// combineReducers用于合并多个reducer函数 因为有可能会有多个reducer 但createStore(参数) 中参数只能接收单一值，所以把其合并
const reducer = combineReducers({
  CollApsedReducer,
  LoadingReducer,
});
const store = createStore(reducer);
//暴露store
export default store;

/* 
	store.dispatch(action)
	store.subscribe(listener)
*/
